<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>用户列表</title>
    <script type="text/javascript" src="../js/jquery-1.11.3.min.js"></script>
    <script type="text/javascript">
        $(function () {
            $.ajax({
                url: "../client/user.do",
                type: "GET",
                data: {action: 'queryAll'},
                success: function (data) {
                    console.log(data);
                    var obj = JSON.parse(data);
                    for (let i = 0; i < obj.length; i++) {
                        var trElement = '<tr><td>' + obj[i].id + '</td><td>' + obj[i].username + '</td><td>' + obj[i].password + '</td></tr>';
                        $('#user_table').append(trElement);
                    }
                },
                dataType: 'text'
            });
        });
    </script>

</head>
<body>
<h1>用户列表查看</h1>
<table>
    <thead>
    <tr>
        <td>ID</td>
        <td>用户名</td>
        <td>密码</td>
    </tr>
    </thead>
    <tbody id="user_table">

    </tbody>
</table>
</body>
</html>